package com.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateUtils {
	
	public static Date getCurrentDate()
	{
		Calendar currentCalendar = Calendar.getInstance();
		currentCalendar.add(Calendar.HOUR, -3);
		Date date = new Date(currentCalendar.getTimeInMillis());
		System.out.println("Date :"+date);
		return date;
	}
	
	public static String getCurrentDateWithoutTime()
	{
		Calendar currentCalendar = Calendar.getInstance();
		currentCalendar.add(Calendar.HOUR, -3);
		DateFormat simDateFormat =  new SimpleDateFormat ("dd/MM/yyyy");
		String sDate = simDateFormat.format(currentCalendar.getTime());
		System.out.println("Date :"+sDate);
		return sDate;
	}

}
